package message;

import java.nio.ByteBuffer;
import java.util.function.Consumer;

public abstract class AbstractMessageBuilder implements MessageBuilder {

	protected Consumer<? super Object> callback;
	protected Object build;

	public AbstractMessageBuilder(Consumer<? super Object> callback) {
		this.callback = callback;
	}
	
	@Override
	public boolean read(ByteBuffer byteBuffer) {
		callback.accept(build);
		return true;
	}
	
//	public Object getValue() {
//		return build;
//	}
	
}
